#!/usr/bin/env python
# Create: 2019/5/8
__author__ = '749B'

import requests
from orionsdk import SwisClient

from sds import settings

requests.packages.urllib3.disable_warnings()

npm_server = settings.npm_server
username = settings.username
password = settings.password

swis = SwisClient(npm_server, username, password)
results = swis.query("SELECT EventType, Name FROM Orion.EventTypes")
print(results['results'])

event_type_map = dict()
for item in results['results']:
    event_type_map[item['EventType']] = item['Name']

print(event_type_map)

